/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.base.entity.StoreCare;

/**
 * 客户采纳护理项目Entity
 * @author lvbo
 * @version 2013-06-20
 */
@Entity
@Table(name = "store_customer_solution_care")
@IdClass(CustomerSolutionCarePK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CustomerSolutionAndCare extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private CustomerSolution customerSolution; //客户采纳方案
	private StoreCare storeCare; //客户采纳护理项目
	private Date notifyDate; //下次提醒日期
	private int remain_times; //剩余护理次数
	
	public CustomerSolutionAndCare() {
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SCS_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public CustomerSolution getCustomerSolution() {
		return customerSolution;
	}

	public void setCustomerSolution(CustomerSolution customerSolution) {
		this.customerSolution = customerSolution;
	}

	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="CARE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreCare getStoreCare() {
		return storeCare;
	}

	public void setStoreCare(StoreCare storeCare) {
		this.storeCare = storeCare;
	}

	public Date getNotifyDate() {
		return notifyDate;
	}

	public void setNotifyDate(Date notifyDate) {
		this.notifyDate = notifyDate;
	}

	public int getRemain_times() {
		return remain_times;
	}

	public void setRemain_times(int remain_times) {
		this.remain_times = remain_times;
	}
}


